package cn.lhf.myblog.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SHA512Utils {
    public static String getSHA512(String str) {
        try {
            MessageDigest md = MessageDigest.getInstance("sha512");
            byte[] digest = md.digest(str.getBytes());
            return StringUtils.toHex(new String(digest));
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }

}
